FROM golang:1.14.2
WORKDIR /go/src/github.com/sparkdevo/href-counter/
ADD conf /conf
ADD echo-web /echo-web
RUN go get -d -v golang.org/x/net/html
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .

FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=0 /go/src/github.com/sparkdevo/href-counter/app .
EXPOSE 8080
CMD ["./app"]